<?php
/**
 * Created by PhpStorm
 * User: Jhinwy
 * Date: 5/10/24
 * Time: 11:22 AM
 */

namespace app\adminapi\controller\shield;

use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\shield\BlackCityLists;
use app\adminapi\logic\shield\BlackCityLogic;


/**
 * 城市地区屏蔽（黑名单）
 *
 * Class OrderController
 * @package app\adminapi\controller
 */
class BlackCityController extends BaseAdminController
{

    /**
     * 屏蔽城市列表
     *
     * @return \think\response\Json
     */
    public function lists()
    {
        return $this->dataLists(new BlackCityLists());
    }


    /**
     * 新增屏蔽城市
     *
     * @return \think\response\Json
     */
    public function save()
    {
        $params = $this->request->post();

        return BlackCityLogic::save($params) ?
            $this->success('更新成功', [], 1, 1) : $this->fail('失败');
    }


    /**
     * 删除屏蔽城市
     *
     * @return \think\response\Json
     */
    public function delete()
    {
        $id = $this->request->post('id');

        return BlackCityLogic::delete($id) ?
            $this->success('删除成功', [], 1, 1) : $this->fail('失败');
    }
}
